[
    async function(kuo,Context,context){    
        Context.headers["content-type"] ="text/xml; charset=UTF-8";
        this.$features = await Kuoplus("cms");
        let HCTime = Mode("Tools").Int(this.$features.configure['缓存时间']['0']);
        let HASH ="html/seo_sitemap";
        Context.Cache = true;
        if(HCTime  > 0){
            let neirong = await Mem.Get(HASH);
            if(neirong){
                Context.body = neirong
                return ;
            }
        }
        let $DB = await db('cms_type');
        let XML = ['<?xml version="1.0" encoding="UTF-8"?>'];
        XML.push('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">');
        XML.push('<url>');
        XML.push('<loc>'+WZHOST+'</loc>');
        XML.push('<lastmod>'+Mode("Tools").Date('Y-m-d')+'</lastmod>');
        XML.push('<changefreq>always</changefreq>');
        XML.push('<priority>1.0</priority>');
        XML.push('</url>');

        let $hh = await $DB.Zhicha('url,atime').Where({'off':2}).Select();
        if($hh){
            for(var tt in $hh){
                let $DATA = $hh[tt];
                XML.push('<url>');
                XML.push('<loc>'+KuoLink([kuo.class, $DATA['url'] ])+'</loc>');
                XML.push('<lastmod>'+Mode("Tools").Date('Y-m-d',$DATA['atime'])+'</lastmod>');
                XML.push('<changefreq>always</changefreq>');
                XML.push('<priority>1.0</priority>');
                XML.push('</url>');
            }
        }
        $DB = await $DB.SetTable("cms_content");
        $hh = await $DB.Zhicha('url,atime').Where({'off':2}).Limit(2000).Select();
        if($hh){
            for(var tt in $hh){
                let $DATA = $hh[tt];
                XML.push('<url>');
                XML.push('<loc>'+KuoLink([kuo.class, $DATA['url'] ])+'</loc>');
                XML.push('<lastmod>'+Mode("Tools").Date('Y-m-d',$DATA['atime'])+'</lastmod>');
                XML.push('<changefreq>always</changefreq>');
                XML.push('<priority>1.0</priority>');
                XML.push('</url>');
            }
        }
        XML.push('</urlset>');
        Context.body = implode("\n",XML);
        if(HCTime  > 0 && Context.Cache){
            await Mem.Set(HASH,Context.body,HCTime);
        }
    }
]